package com.lmt_28;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.util.Scanner;

public class ClientMulty {
    public static void main(String[] args) throws Exception {
        DatagramSocket socket = new DatagramSocket();
        Scanner sc = new Scanner(System.in);
        while (true)
        {
            System.out.println("请输入");
            String data = sc.nextLine();
            byte[] bytes = data.getBytes();
            if ("exit".equals(data)){
                socket.close();
                break;
            }
            DatagramPacket packet = new DatagramPacket(bytes,bytes.length, InetAddress.getLocalHost(),6666);
            socket.send(packet);
        }
    }
}
